import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state:{
        typeId:0,//定位城市
        housesId:null, //楼盘id
        hasMapSearch:false, //楼盘id
    },
    getters: {

    },
    mutations: {
        _locTypeId(state,data){
            state.typeId = data
            console.log('切换分类id======',data)
        },
        _changeHousesId(state,data){   //房子id
            state.housesId = data.id
        },
        _changeHasMapSearch(state,data){  //地图搜索
            state.hasMapSearch = data
        }
    },
    actions:{
        locTypeId(conentText,data){
            conentText.commit('_locTypeId',data)
        },
        changeHousesId(conentText,data){
            conentText.commit('_changeHousesId',data)
        },
        changeHasMapSearch(conentText,data){
            conentText.commit('_changeHasMapSearch',data)
        },
    }
})